#include <iostream>
#include <climits>
using namespace std;

int min(int a, int b, int c)
{
    // 剔除负数
    a = a<0? INT_MAX : a;
    b = b<0? INT_MAX : b;
    c = c<0? INT_MAX : c;

    int m =a<b ? a : b;
    return m<c ? m : c;
}

int main(int argc, char const *argv[])
{
    // 硬币的基础值
    const int a = 2;
    const int b = 5;
    const int c = 7;

    // 需要组合而成的总价值
    int m;
    cin >> m;

    // 计算至少需要几枚硬币组成总价值m
    int f[m+1];
    f[1] = INT_MAX;
    f[2] = 1;
    f[3] = INT_MAX;
    f[4] = 2;
    f[5] = 1;
    f[6] = 3;
    f[7] = 1;

    for(int i=8; i<=m; i++)
        f[i] = min(f[i-2]+1, f[i-5]+1, f[i-7]+1);

    cout << "至少"<< f[m] <<"枚硬币" << endl;

    return 0;
}
